<template>
  <el-select v-model="inputValue" v-bind="$attrs">
    <el-option v-if="isAll" label="全部" value=""></el-option>
    <el-option
      v-for="option in $store.state.data.OPTION_MAP[dictCode]"
      :key="option.label"
      :label="option.label"
      :value="option.value"
    >
    </el-option>
  </el-select>
</template>

<script>
export default {
  name: "DicSelect",
  model: {
    prop: "value",
    event: "change",
  },
  props: {
    value: {
      type: [String, Number, Array],
      default: "",
    },
    /**
     * 字典标识，默认 审批状态
     */
    dictCode: {
      type: String,
      default: "inst_appro_status",
    },

    /**
     * 是否包含全部选项
     */
    isAll: {
      type: Boolean,
      default: true,
    },
  },
  data() {
    return {};
  },
  computed: {
    // 选中值
    inputValue: {
      get() {
        return this.value;
      },
      // set(val) {
      //   const label = val ? this.dataOptions[val] : "";
      //   this.$emit("change", val, label);
      // },
    },
  },
};
</script>

<style lang="scss" scoped>
[multiple] {
  border: none;
}

.el-select {
  padding: 0 !important;
}
</style>
